/*
 * @Description: 
 * @Version: 0.0.0
 * @Autor: 源
 * @Date: 2022-10-26 11:05:38
 * @LastEditors: 源
 * @LastEditTime: 2022-10-26 11:09:05
 * @FilePath: \pnpm-v3-ts-ui\docs\.vitepress\vitepress\vue\directive\highlight.ts
 */
import hljs from "highlight.js";//导入代码高亮样式
// 样式文件
import('highlight.js/styles/vs2015.css');
hljs.configure({
  ignoreUnescapedHTML: true,
  languages: [
    "javascript",
    "css",
    "html",
    "json",
    "http",
    "",
  ],
});
export default function (el) {// 注册指令
  const blocks = el.querySelectorAll("pre code");
  blocks.forEach((block) => {
    hljs.highlightElement(block);
  });
}